module.exports = function ($scope, $state, $resource, $modal, toaster ){
    //查询法律法规列表
    $scope.search = function (pageNo){
      
      
        var para = { 
            'travel_name': $scope.info.travel_name,
            'travel_license_no': $scope.info.travel_license_no,
            'travel_legal_person_name': $scope.info.travel_legal_person_name,
            'travel_legal_person_no': $scope.info.travel_legal_person_no,
            'pageNo': pageNo || $scope.currentPage,
            'pageSize': $scope.itemsPerPage
            
        }
        $resource('/api/as/goc/peopeninfo/findHisOpenList', {}, {}).save(para, function(res){
            if(res.errcode === 0){
                $scope.list = res.data.results;
                $scope.totalItems = res.data.totalRecord;

                $scope.currentPage = pageNo;
            }else{
                toaster.error({title: '', body: res.errmsg});
            }
        });
    }
    


    init();
    //初始化列表
    function init(){
        $scope.currentPage = 1;		//当前页码
        $scope.itemsPerPage = 10;	//每页显示几条
        $scope.search(1);
    }


        //查看
        $scope.gatLawInfo = function(info) {
            info.openstate = true;
            info.hisstate = true;
            info.examinestate = true;
            var modalInstance = $modal.open({
                template: require('../views/saveOpenInfo.html'),
                controller: 'saveOpenInfo',
                size: 'lg',
                resolve: {
                    item : function () {
                        return info;
                    },
                    flag : function () {
                        return info == 1;
                    }
                }
            });
            //关闭模态框刷新页面
            modalInstance.result.then(function() {
                init();
            });
        }

    
};